//latch.v
module latch(
    input       a,
    input       b,
    output reg  y
);
    
    always@(*) begin
      case (a)
        1: y = b;
        default : y = 0;
      endcase
    end

endmodule
